import request from '@/utils/request'

export function getDicts(query) {
  return request({
    url: '/web-api/base/code/listAll',
    method: 'get',
    params: query
  })
}

export function getlistLevel(query) {
  return request({
    url: '/web-api/base/code/listLevel',
    method: 'get',
    params: query
  })
}

export function add(data) {
  return request({
    url: '/web-api/base/code',
    method: 'post',
    data
  })
}

export function del(id) {
  return request({
    url: '/web-api/base/code/' + id,
    method: 'delete'
  })
}

export function edit(data) {
  return request({
    url: '/web-api/base/code',
    method: 'put',
    data
  })
}

export default { add, edit, del }
